feat(docs): add --content-format markdown to +write helper#383
feat(docs): add --content-format markdown to +write helper#383raajheshkannaa wants to merge 1 commit intogoogleworkspace:mainfrom
Conversation
Parse markdown input and convert to Google Docs API batchUpdate requests with proper formatting (headings, bold, italic, inline code, code blocks, links, ordered/unordered lists). Uses pulldown-cmark for markdown parsing. Generates a single insertText request followed by updateParagraphStyle/updateTextStyle/ createParagraphBullets requests with correct 1-based UTF-16 character indices. Fixes googleworkspace#380
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable feature for writing markdown content to Google Docs. The implementation is robust, leveraging pulldown-cmark for parsing and correctly handling UTF-16 indices for the Google Docs API. The new code is well-structured and includes a comprehensive set of unit tests for the markdown conversion logic. One point of feedback: the documentation file skills/gws-docs-write/SKILL.md was not updated to include the new --content-format flag. Please update this file to reflect the changes and new examples.
|
I'm not sure if this is the best path for this tool to include at this time. I'm concerned about this translation layer and the various edge cases. |
|
Thanks for the contribution and the effort here! After thinking on it, I'm going to close this for now. The gws CLI is designed to be a thin transport layer over the Google APIs, and adding a markdown→Docs API translation layer introduces a lot of edge-case complexity that I don't think fits that philosophy. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #383 +/- ##
==========================================
+ Coverage 63.23% 64.30% +1.07%
==========================================
Files 38 39 +1
Lines 15102 15651 +549
==========================================
+ Hits 9549 10064 +515
- Misses 5553 5587 +34 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Adds
--content-format markdownflag to thegws docs +writehelper. When set, markdown input is parsed and converted to Google Docs APIbatchUpdaterequests with proper formatting.Supported markdown
updateParagraphStylewithnamedStyleTypeupdateTextStyleCourier New)updateTextStylewithlink.urlcreateParagraphBulletscreateParagraphBulletsImplementation
pulldown-cmark(MIT, pure Rust, widely used) for markdown parsinginsertTextrequest (full concatenated text) followed by N formatting requests--content-formatusesvalue_parserto constrain toplaintextormarkdownTests
13 unit tests in
docs_markdown.rs+ 2 integration tests indocs.rs. All 545 existing tests continue to pass.Future work (not in this PR)
InsertTableRequest)InsertInlineImageRequest)Fixes #380